const NODE_ENV_PRODUCTION = 'production'
const SITE_ROOT_PATH = 'https://www.***.com/app/'
export const RES_CODE_OK = '0'
export const IS_PRO = process.env.NODE_ENV === NODE_ENV_PRODUCTION
export const NO_DATA_TEXT = '暂无数据'
export const AJAX_SERVICE_HOST = IS_PRO
  ? '//www.***.com/api/'
  : '//test.***.com/api/'

export const SITE_PATH = (() => {
  return IS_PRO
    ? `${SITE_ROOT_PATH}static/view/`
    : 'http://www.****.dev/'
})()

let appVersion = null
export function getAppVersion() {
  if (!appVersion) {
    appVersion = localStorage.getItem('version') || Date.now()
  }
  return appVersion
}

export const servicePhone = '028-85980782'

export const CAN_NOT_BACK_VIEWS = {
  '/user': true
}

export const uploadToken = { avatar: 1, esfcommcert: 2, esfimg: 3 }

export const HTTP_HOST = `${location.protocol}//${location.host}/`

export const HTTP_PATH = `${location.origin}${location.pathname}`